The present invention relates to a method and an apparatus for coloring or recoloring a desired domain in a visual image without impairing the naturalness of shades.
Computer-aided design (CAD) has been introduced into the field of color design, and is now desirable to apply it to the coloring and recoloring of visual images. More specifically, a visual image including the object of design (an automobile, for instance) is inputted into a computer system through a scanner or a color camera. After reproducing it on a color display, the object domain is colored if it was previously uncolored or, is recolored, if it was already colored (for example, to recolor the red body of the automobile into blue). It is not simple to change the color in a natural-looking way because the color of the object, even though it is evenly colored, is shaded by the reflection and/or transmission of light. However, the following technique has already been proposed in the U.S. patent application Ser. No. 07/173,164 filed Mar. 25, 1988 by the same inventor as that of the present invention, as will now be described. Light beams coming from a source and reflected by an object to enter into a camera can be broadly classified into a mirror reflection beam and a diffuse reflection beam. The former, reflected off the surface of the object, changes only in intensity, while its spectral composition remains the same as the source. The latter results from the absorption of the light from the source into the object and its isotropic external emission. The spectral composition of the diffuse reflection beam usually differs from that of the source beam. Accordingly, the three components (R (Red), G (Green), B (Blue)) of each point on the object face can be represented by: ##EQU1## where (R.sub.o, G.sub.o, B.sub.o) are the three components of the diffuse reflection beam, which vary from object to object and, therefore, will be called the "object color"; (R.sub.s, G.sub.s, B.sub.s) are those of the mirror reflection beam, which are respectively equal to those of the light at its source and, therefore, will be here after called the "source color"; .alpha. and .beta. are matrices, which represent the contributions of the diffuse reflection beam and the mirror reflection beam, respectively, to the luminous energy emitted, and are affected by the material and orientation of the reflecting surface. Since they differ from pixel to pixel, the three components of a given pixel whose position in the image is (x, y), can be represented by: ##EQU2## If the source colors and the object colors are known, .alpha.(x, y) and .beta.(x, y) can be calculated from (R.sub.(x, y), G.sub.(x, y), B.sub.(x, y)).
To figure out how an object of the same material in a different color will look, the pixel values are calculated by Equation (3) in which only the color of the object is altered to (R.sub.o ', G.sub.o ', B.sub.o '). ##EQU3##
This model, however, presupposes that the object color and the source color are independent of each other in the RGB space. As a consequence, if an originally uncolored (i.e., achromatic) region is to be colored, .alpha.(x, y) and .beta.(x, y) cannot be figured out because the directions of the object color and the source color are parallel in the chromatic space. Hence, uncolored object cannot be colored by this conventional manner.
Moreover, since this is a physical model constructed for use with an object made of plastic or the like, its application to a color transmitted by a transparent object or one reflected by cloth or the like, even if the image is similarly shaded, may not necessarily provide a natural-looking image.